﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Zeus.Thunder.Core;

namespace SharpTrainer.Basic
{
    class ArrayCopyTest : ITestCase
    {
        public void Run()
        {
            string[] arrSrc1 = new string[] { "0", "1", "2" };
            string[] arrSrc2 = new string[] { "a", "b", "c", "d" };
            string[] arrDst = new string[arrSrc1.Length + arrSrc2.Length];

            Console.WriteLine("Source Array1:");
            Display(arrSrc1);
            Console.WriteLine("Source Array2:");
            Display(arrSrc2);
            
            arrSrc1.CopyTo(arrDst, 0);
            arrSrc2.CopyTo(arrDst, arrSrc1.Length);
            
            Console.WriteLine("Dest Array:");
            Display(arrDst);
        }

        private void Display(string[] arr)
        {
            for (int i = 0; i < arr.Length; i++)
            {
                Console.WriteLine(arr[i]);
            }
        }
    }
}
